package com.huaxinkaiye.utils;

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.widget.TextView;

/**
 * Created by hanshu on 15/1/31.
 */
public class ViewUtil {
    public static boolean checkIsEmpty(Context context, TextView textView, String message) {
        if (TextUtils.isEmpty(textView.getText().toString())) {
            ToastUtil.show(context, message);
            return true;
        }
        return false;
    }

    public static void zoomView(View view) {
        ObjectAnimator animator1 = ObjectAnimator.ofFloat(view, "scaleX", 0.8f, 1.6f, 1f);
        ObjectAnimator animator2 = ObjectAnimator.ofFloat(view, "scaleY", 0.8f, 1.6f, 1f);
        animator1.setDuration(600);
        animator2.setDuration(600);
        AnimatorSet set = new AnimatorSet();
        set.setInterpolator(new AccelerateDecelerateInterpolator());
        set.playTogether(animator1, animator2);
        set.start();
    }
}
